package blog.service.impl.back;

import blog.dao.back.ReportBackMapper;
import blog.entity.Consumer;
import blog.entity.Report;
import blog.service.back.ReportBackService;
import blog.vo.back.*;
import blog.vo.common.PaginationVO;
import cn.hutool.core.bean.BeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 　　* @description: TODO
 * 　　* @param
 * 　　* @return
 * 　　* @throws
 * 　　* @author Administrator
 * 　　* @date $ $
 *
 */
@Service
public class ReportBackServiceImpl implements ReportBackService {
    @Autowired
    private ReportBackMapper reportBackMapper;

    @Override
    public List<ReportVO> getAllReportInfo(PaginationVO paginationVO) {
        return reportBackMapper.getAllReportInfo(paginationVO.getPageNum(),paginationVO.getPageSize());
    }

    @Override
    public List<ReportVO> byReportStatusGetAllReportInfo(ByReportStatusGetAllReportInfoVO byReportStatusGetAllReportInfoVO) {
        return reportBackMapper.byReportStatusGetAllReportInfo(byReportStatusGetAllReportInfoVO);
    }

    @Override
    public Report byReportUuidAndBlogUuidGetReportInfo(ByReportUuidAndBlogUuidGetReportInfoVO byReportUuidAndBlogUuidGetReportInfoVO) {
       return reportBackMapper.byReportUuidAndBlogUuidGetReportInfo(byReportUuidAndBlogUuidGetReportInfoVO.getBlogUuid(),byReportUuidAndBlogUuidGetReportInfoVO.getReportUuid());
    }

    @Override
    public int updateReportStatus(UpdateReportStatusVO updateReportStatusVO) {
        Report report = BeanUtil.copyProperties(updateReportStatusVO, Report.class);
        return reportBackMapper.updateReportStatus(report);
    }
}
